<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url() . 'style/admin/css/public.css' ?>">
    <script type="text/javascript" src="<?php echo base_url() ?>org/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        window.UEDITOR_HOME_URL = "<?php echo base_url() ?>org/ueditor/";
        window.onload = function(){
            window.UEDITOR_CONFIG.initialFrameWidth = 800;
            window.UEDITOR_CONFIG.initialFrameHeight = 400;
            UE.getEditor('content');
        }
    </script>
    <script type="text/javascript" src="<?php echo base_url() ?>org/ueditor/ueditor.config.js"></script>
	<title>Document</title>
	<style type="text/css">
		span{
			color: #f00;
		}
	</style>
</head>
<body>
	<form action="<?php echo site_url('admin/article/runEditArticle') ?>" method="POST" enctype="multipart/form-data">
	<table class="table">
		<tr >
			<td class="th" colspan="10">编辑文章<?php echo $error; ?></td>
		</tr>
		<tr>
			<td>标题</td>
			<td><input type="text" name="title" value="<?php echo $article['title'] ?>"/>
			<?php echo form_error('title', '<span>', '</span>') ?>
			</td>
		</tr>
		<tr>
			<td>类型</td>
			<td>
				<input type="radio" name="type" value="0"<?php if($article['type'] == 0) echo set_radio('type', '0', TRUE); ?>/> 普通
				<input type="radio" name="type" value="1"<?php if($article['type'] == 1) echo set_radio('type', '1', TRUE); ?>/> 热门
			</td>
		</tr>
		<tr>
			<td>栏目</td>
			<td>
				<select name="cid" id="cid">
					<?php foreach($cate as $v): ?>
					<option value="<?php echo $v['cid'] ?>"<?php if($article['cid'] == $v['cid']) echo set_select('cid', $v['cid'], TRUE) ?>><?php echo $v['cname'] ?></option>
                    <?php endforeach ?>
				</select>
			</td>
		</tr>
		<tr>
			<td>缩略图</td>
			<td>
                <img alt="缩略图"  src="<?php echo base_url() . 'upload/' . $article['thumb'] ?>" />
				<input type="file" name="thumb" />
                <input type="hidden" name="orig" value="<?php echo $article['thumb'] ?>" />
			</td>
		</tr>
		<tr>
			<td>摘要</td>
			<td>
				<textarea name="info" id="" style="width:550px;height:160px;"><?php echo $article['info'] ?></textarea><?php echo form_error('info', '<span>', '</span>') ?>
			</td>
		</tr>
		<tr>
			<td>内容</td>
			<td>
				<textarea name="content" id="content" style="width:550px;height:500px;"><?php echo htmlspecialchars_decode($article['content']); ?></textarea>
				<?php echo form_error('content', '<span>', '</span>') ?>
			</td>
		</tr>
		<tr>
			<td colspan="10">
                <input type="hidden" name="aid" value="<?php echo $article['aid'] ?>"/>
                <input type="submit" class="input_button" value="修改"/>
            </td>
		</tr>
	</table>
	</form>
</body>
</html>